package com.example.jobback.controller.manager;

import com.example.jobback.resp.manager.common.manager.GetManagerMessageResp;
import com.example.jobback.resp.manager.common.company.MCrossCompanyMessageResp;
import com.example.jobback.resp.manager.common.recruiter.MCrossRecruiterMessageResp;
import com.example.jobback.resp.manager.common.seeker.MCrossSeekerMessageResp;
import com.example.jobback.result.Result;
import com.example.jobback.service.manager.ManagerCommonService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: ManagerCommonController
 * @Description:管理员-通用控制器
 * @Author: lhb
 * @Date: 2025/6/24
 */
@RestController
@RequestMapping("/manager/common")
@Tag(name = "管理员-通用控制器",description = "管理员通用服务的相关接口")
public class ManagerCommonController {

    private final ManagerCommonService managerCommonService;

    public ManagerCommonController(ManagerCommonService managerCommonService) {
        this.managerCommonService = managerCommonService;
    }


    @Operation(summary = "获取指定公司招聘者基本信息",description = "跨服务，调用方")
    @GetMapping("/getRecruiterBasicMessage")
    @ApiResponse(description = "返回公司招聘者响应体")
    public Result<MCrossRecruiterMessageResp> getRecruiterBasicMessage(@Parameter(description = "指定用户的userId", required = true)
                                                                      @RequestParam Long userId){
        return managerCommonService.getRecruiterBasicMessage(userId);
    }



    @Operation(summary = "获取指定求职者基本信息",description = "跨服务，调用方")
    @GetMapping("/getSeekerBasicMessage")
    @ApiResponse(description = "返回求职者响应体")
    public Result<MCrossSeekerMessageResp> getSeekerBasicMessage(@Parameter(description = "指定用户的userId", required = true)
                                             @RequestParam Long userId){
        return managerCommonService.getSeekerBasicMessage(userId);
    }



    @Operation(summary = "获取指定管理员基本信息",description = "无")
    @GetMapping("/getManagerBasicMessage")
    @ApiResponse(description = "返回管理员响应体")
    public Result<GetManagerMessageResp> getManagerBasicMessage(@Parameter(description = "指定用户的userId", required = true)
                                             @RequestParam Long userId){
        return managerCommonService.getManagerBasicMessage(userId);
    }

    @Operation(summary = "获取指定公司信息",description = "跨服务，调用方")
    @GetMapping("/getCompanyMessage")
    @ApiResponse(description = "返回公司信息响应体")
    public Result<MCrossCompanyMessageResp> getCompanyMessage(@Parameter(description = "指定指定公司的userId", required = true)
                                                                @RequestParam Long companyId){
        return managerCommonService.getCompanyMessage(companyId);
    }


}
